local skel = fk.CreateSkill {
  name = "emo__cangyun",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__cangyun"] = "藏云",
  [":emo__cangyun"] = "锁定技，当目标为角色的锦囊牌被抵消时，你选一项：1.摸一张牌，2.弃置两张牌令此牌依旧生效。",
  ["#emo__cangyun-discard"] = "藏云：你可弃置2张牌，令%arg对 %dest 生效",
}

skel:addEffect(fk.CardEffectCancelledOut, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and data.card.type == Card.TypeTrick and data.to
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local cards = room:askToDiscard(player, {
      min_num = 2,
      max_num = 2,
      include_equip = true,
      skill_name = skel.name,
      cancelable = true,
      prompt = "#emo__cangyun-discard::" .. data.to.id .. ":" .. data.card:toLogString()
    })
    if #cards == 2 then
      data.isCancellOut = false
    else
      player:drawCards(1, skel.name)
    end
  end,
})

return skel
